<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>销售订单详情表</title>
	<%@ include file="/common/meta.jsp" %>
	<script src="${ctx}/js/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/logic/Reports";
		var basic_WUrl="/logic/Reports";
		var basic_Title="销售订单详情表";
		var grid;
		function createSearch(){
			init(1,10,'80,100,80,100,80,100,80,100,80,100','10%');
			//第一行的数据
			addCommon(0,0,"lable","物料名称：");
			addCommon(0,1,"txtlike","gsi.zd008MaterialsName");
			addCommon(0,2,"lable","客户名称：");
			addCommon(0,3,"txtlike","gs.zd006CustomerName");
			addCommon(0,4,"lable","客户编号：");
			addCommon(0,5,"txtlike","gs.zd005CustomerCode");
			addCommon(0,6,"lable","建单起始日期");
			addCommon(0,7,"datestart","gs.bizCreatorDate");
			addCommon(0,8,"lable","建单结束日期");
			addCommon(0,9,"dateend","gs.bizCreatorDate");
		}
		
		function searchAP(){
			multipleSearch("#table1",true,"",basic_Url+"/repSaleOrderList.do");
		}
		document.onkeydown=keyListener;   
		function keyListener(e){   
		    e = e ? e : event;  
		    if(e.keyCode == 13){   
		    	searchAP();
		    }   
		}  	
		$(function(){
			grid = $("#table1").ligerGrid({
		        columns: [
						  { display: '销售订单号', name: 'zd001SalesCode', width: 120 },
						  { display: '销售类型', name: 'zd001SalesType', width: 80 ,render : function(item){
							  var zdSaleType = item.zd001SalesType;
							  if(zdSaleType=='1'){
								  return "普通";
							  }
							  if(zdSaleType=='0'){
								  return "加单";
							  }
						  }},
						  { display: '产品类型', name: 'zd001SalesModel', width: 80 ,render : function(item){
							  var zdSaleModel = item.zd001SalesModel;
							  if(zdSaleModel=='MT'){
								  return "床垫";
							  }
							  if(zdSaleModel=='BT'){
								  return "套床";
							  }
						  } },
		                  { display: 'pi编号', name: 'zd002PiCode', width: 120 },
		                  { display: '客户id', name: 'zd003CustId', width:1,hide:true},
		                  { display: '客户名称', name: 'zd003CustName', width: 140},
		                  { display: '客户编码', name: 'zd003CustCode', width: 80},
		                  { display: '物料id', name: 'zd004MaterId', width:1,hide:true},
		                  { display: '物料编码', name: 'zd004MaterCode', width:1,hide:true},
		                  { display: '物料名称', name: 'zd004MaterName', width: 120},
		                  { display: '规格型号', name: 'zd004MaterModel', width:100},
		                  { display: '物料尺寸', name: 'zd004MaterSpec', width:100},
		                  { display: '物料颜色', name: 'zd004MaterColor', width:100},
		                  { display: '物料材质', name: 'zd004MaterQuanlity', width:100},
		                  { display: '单位', name: 'zd004MaterUnit', width:80},
		                  { display: '数量 ', name: 'zd008Quantity', width: 100,render: function (item){
		                		if(item.zd008Quantity==''||item.zd008Quantity==null||parseFloat(item.zd008Quantity)==0){
		                			return '0.0000';
		                		}
		                	 	return item.zd008Quantity.toFixed(4);
		                  }},
		                  { display: '业务员', name: 'zd005Clerk', width:80},
		                  { display: '建单日期', name: 'zd006OrderDate', width:100,render: function (item){
	                		  var orderdate=new Date(item.zd006OrderDate);
	                		  return formatDate(orderdate,"yyyy-MM-dd");
	                	  }},
		                  { display: '交货日期', name: 'zd007DeliveryDate', width:100,render: function (item){
	                		  var dvydate=new Date(item.zd007DeliveryDate);
	                		  return formatDate(dvydate,"yyyy-MM-dd");
	                	  }},
	                	  { display: '描述', name: 'zd004MaterDescript', width:140}
		                  ],
		                  enabledEdit: true,
		                  usePager: false, rownumbers: true, 
		                  url:basic_Url+"/repSaleOrderList.do",
		                  width: "100%", height:'100%',
		                  enabledSort:false
		                  });
				$("#pageloading").hide();
			});
		function excelExport(){
		   	var filtersStr = generateCondition();
		   	var path = "${ctx}/excel/salesOrderExcel.do?filters="+filtersStr+"&_search=true";
			window.open(path,"_blank");
	  }
		</script>
	 
  </head>
 <body style="padding:10px" onload="createSearch()">  
       <div id="layout1">

          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
			             	 <li><div class="buttonActive"><div class="buttonContent"><button type="submit"  onclick="excelExport()">导出</button></div></div></li>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
    </body>
</html>